<?php

namespace app\models\auth_app\msg\douyin;

use app\models\AuthAccount;
use Yii;
use app\components\Func;

/**
 * 用户解除授权".
 */
class Unauthorize extends \app\models\AuthAppMsg
{
    public function run(){
        $msg_arr = json_decode($this->content, 1);
        $authAccount = AuthAccount::getObjByOpenId($msg_arr['from_user_id']);
        if(empty($authAccount)) return;
        $authAccount->state = AuthAccount::STATE_UNAUTH;
        $authAccount->save();
    }
}
